package org.example.exampreparationtreasure.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.exampreparationtreasure.model.entity.User;

import java.io.Serializable;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    /**
     * 根据用户id查询
     * @param userId
     * @return 用户对象
     */
    User selectById(Long userId);

    /**
     * 根据用户名查询
     * @param username
     * @return 用户对象
     */
    @Select("select * from sys_user where username = #{username}")
    User selectByUsername(String username);
}
